#pragma once

/*The direct input version we are using*/
#define DIRECTINPUT_VERSION 0x0800

/*Include the input header from direct x*/
#include <dinput.h>

/*Link the library in code*/
#pragma comment(lib, "dinput8.lib")

class Input
{
	/////////////////////////////////////////////////////////////////////////////////////////////////////
	/*Data Structures and Arrays*/
	/////////////////////////////////////////////////////////////////////////////////////////////////////
	
	/*Array used to check which key is being pressed*/
	char m_KeyboardState[256];

	/*Array used to make sure that not more than one time the button is checked*/
	bool m_KeyDown[256];

	/*The structure used to check the mouse Input*/
	DIMOUSESTATE2 m_MouseState;

	/////////////////////////////////////////////////////////////////////////////////////////////////////
	/*Pointers and Handles*/
	/////////////////////////////////////////////////////////////////////////////////////////////////////

	/*The input device*/
	IDirectInput8* m_InputDevice;

	/*The keyboard Device*/
	IDirectInputDevice8* m_Keyboard;

	/*The mouse Device*/
	IDirectInputDevice8* m_Mouse;

	/////////////////////////////////////////////////////////////////////////////////////////////////////
	/*Private Functions*/
	/////////////////////////////////////////////////////////////////////////////////////////////////////
	
	/*Copy constructor*/
	Input(const Input& in);

	/*Overload of the = operator to call the copy constructor*/
	Input& operator=(const Input& in);
public:

	/*The constructor we want to run*/
	Input(HINSTANCE hInst, HWND hWnd);

	/*The default destructor*/
	~Input(void);

	/*The function to acquire the input*/
	void acquire();

	/*The function to check if the sent in key was pressed*/
	bool keyDown(unsigned char key);

	/*The function to check if the sent in button was pressed*/
	bool mouseDown(int button);

	/*The function to return the mouse difference in the X direction*/
	float mouseX();

	/*The function to return the mouse difference in the Y direction*/
	float mouseY();

	/*The function to return the mouse difference in the Z direction*/
	float mouseZ();

	/*The function to return the pointer to the bool array*/
	bool* getBoolArray();

};

